﻿Imports System.Runtime.Serialization

<DataContract()>
Public Class CIdentity
    'MainId
    <DataMember(Order:=1)> Public InstanceId As Integer

	'TempId
	<DataMember(Order:=2)> Public AppId As Integer
	<DataMember(Order:=3)> Public ClientName As String
	<DataMember(Order:=4)> Public ClientSuffix As String
	<DataMember(Order:=5)> Public HostName As String
	<DataMember(Order:=6)> Public MachineName As String
	<DataMember(Order:=7)> Public ConnectionString As String

	'Protobuf
	Shared Sub New()
        CProto.Prepare(Of CIdentity)()
    End Sub
	Public Sub New()
	End Sub
	Public Sub New(id As Integer, appId As Integer, clientName As String, suffix As String, hostName As String, connStr As String)
		Me.InstanceId = id
		Me.AppId = appId
		Me.ClientName = clientName
		Me.ClientSuffix = suffix
		Me.HostName = hostName
		Me.MachineName = My.Computer?.Name
		Me.ConnectionString = connStr
	End Sub
End Class
